/**
 * JUST ANALYZING RIGHT NOW
 * Not for production use right now.
 */

function check() {

    jQuery.noConflict();

    var responseText = "";
    var result = true;

    jQuery(document).ready(function() {
        jQuery.ajax({
            async : false,
            type : 'POST',
            url : "validate",
            data : jQuery("form").serialize(),
            success : function(response) {
                responseText = response;
            }
        });
    });

    var resultArray = responseText.split(':');

    if (resultArray[0] == "true") {
        result = true;
    } else if (resultArray[0] == "false") {
        alert("responseText0:" + resultArray[0]);
        alert("responseText1:" + resultArray[1]);
        jQuery("#dlgText").html(resultArray[1]);
        jQuery("#dlg").dialog('open');
        result = false;
    }

    return result;
}

function showAlert() {
    //alert("testing..");
    jQuery("#dlg").dialog({
        autoOpen : false,
        modal : true,
        overlay : {
            opacity : 0.2,
            background : "gray"
        },
        dialogClass : 'alert',
        buttons : {
            "Ok" : function() {
                jQuery("#dlg").dialog("close");
            }
        }
    });
}

function updateOptionalBlock2() {
    alert("alert")
}
